#include <stdio.h>

/*

	*(a+1）就是a[1]，*(ptr-1)就是a[4],执行结果是2，5 

　　&a+1不是首地址+1，系统会认为加一个a数组的偏移，是偏移了一个数组的大小（本例是5个int） 

　　int *ptr=(int *)(&a+1); 

　　则ptr实际是&(a[5]),也就是a+5 



原因如下： 

　　&a是数组指针，其类型为 int (*)[5]; 

　　而指针加1要根据指针类型加上一定的值，不同类型的指针+1之后增加的大小不同。 

　　a是长度为5的int数组指针，所以要加 5*sizeof(int) 

　　所以ptr实际是a[5] 

　　但是prt与(&a+1)类型是不一样的(这点很重要) 

　　所以prt-1只会减去sizeof(int*) 

　　a,&a的地址是一样的，但意思不一样 

	a是数组首地址，也就是a[0]的地址，&a是对象（数组）首地址，
	
	a+1是数组下一元素的地址，即a[1],&a+1是下一个对象的地址，即a[5]. 

*/

int array1()
{
	int ar[3][4]  = {{3,2,1,0},{3,2,1,0},{3,2,1,0}};
	int array[100];
	

	array[0] = 1;
	array[1] = 1;
	array[2] = 1;
	array[3] = 1;
	array[4] = 1;
	array[5] = 1;
	array[6] = 1;
	array[7] = 1;
	array[8] = 1;
	array[9] = 1;

}

int array2()
{
	int ar[10];
	int aw[10];
	char ac[10];
}

int array3()
{
	int ar[10];
	int aw[10];
	char ac[10];

	ar[0] = 100;
	aw[0] = 50;
	ac[0] = 'a';
	ac[1] = 'b';
	ac[2] = 'c';
	ac[3] = 'd';
	ac[4] = 'e';
	ac[5] = 'f';
	ac[6] = '\0';
}

void array4()
{
	int ar[3][4];

	ar[0][0] = 1;
	ar[0][1] = 2;
	ar[0][2] = 3;
	ar[0][3] = 4;
	ar[1][0] = 5;
	ar[1][1] = 6;
	ar[1][2] = 7;
	ar[1][3] = 8;
}

#define COLS	4

int sum2d(int ar[][COLS], int rows);
int sum (int ar[], int n);

int aaa()
{
	int total1, total2, total3;
	int *pt1;
	int (*pt2)[COLS];

	pt1 = (int [2]) {10, 20};
	pt2 = (int [2][COLS]) { {1, 2, 3, -9}, {4, 5, 6,-8} };

	total1 = sum(pt1, 2);
	total2 = sum2d(pt2, 2);
	total3 = sum((int[]){4,4,4,5,5,5},6);
	printf("total1 = %d\n", total1);	// 30
	printf("total2 = %d\n", total2);	// 4
	printf("total3 = %d\n", total3);	// 27
}

int sum(int ar[], int n)
{
	int i;
	int total = 0;

	for (i = 0; i < n; i++)
		total += ar[i];

	return total;
}

int sum2d(int ar[][COLS], int rows)
{
	int r;
	int c;
	int tot = 0;

	for (r = 0; r < rows; r++)
		for (c = 0; c < COLS; c++)
			tot += ar[r][c];

	return tot;
}

int bbb()
{
	int row = 3, col = 4;
	int ary[row][col];
	
	int array(int col, int row, int ary[col][row]);
	int arra2(int ary[col][row], int col, int row);	// not VLA
	
}

int array_cal(void)
{
	int a[5]={1,2,3,4,9};
	int *ptr1 = (int*)(&a + 1);
	int *ptr2 = (int*)((int)a + 1);
	int temp = (int)(&a + 1 );	// &a+1 = &a + sizeof(a) = &a + 5 * sizeof(int),也就是下一个数组的首地址.

	//printf("temp - : %d, 0x%x, %x, 0x%x\n", temp, *ptr1, ptr1[-1], *ptr2);

	printf("a - 0x%x\n", a);				// 0x859033c0
	printf("a = 0x%x\n", &a);				// 0x859033c0

	printf("a - 0x%x\n", a+1);				// 0x859033c4	0x859033c0+sizeof(int) = 0x859033c0+4 = 0x859033c4
	printf("a = 0x%x\n", &a+1);				// 0x859033d4	0x859033d4 - 0x859033c0 = 0x14 = 20 = sizeof(a)

	printf("temp - 0x%x\n", temp);			// 0x859033d4	&a + 1
	printf("temp = %p\n", temp);			// 0x859033d4	&a + 1	
	printf("temp = %p\n\n", &temp);			// 0x7ffd859033ac	temp self address

	printf("ptr1 - 0x%x, \n", *ptr1);		// 0x0				&a+1 value
	printf("ptr1 - %p\n", *ptr1);			// (nil)			非法地址. 因为是空值，所以没有地址. 
	printf("ptr1 - 0x%x\n", ptr1);			// 0x859033d4		&a+1 ---> %x
	printf("ptr1 - %p\n", ptr1);			// 0x7ffd859033d4	&a+1 ---> %p	
	printf("ptr1 - %p\n\n", &ptr1);			// 0x7ffd859033b0	ptr1 self address ---> %p

	printf("ptr1 - : 0x%x\n", ptr1[-1]);	// 0x9	

	//printf("ptr2 - : 0x%x\n", *ptr2);		// Segmentation fault	取非法地址值
	//printf("ptr2 - %p, \n", *ptr2);			// Segmentation fault	非法地址
	printf("ptr2 - %p\n", ptr2);			// 0xffffffff859033c1	指向的地址。0x859033c0 + 1 = 859033c1
	printf("ptr2 - %p\n\n", &ptr2);			// 0x7ffd859033b8		ptr2 self address ---> %p
		
	return 0;
}

int ccc(void)
{
	int array[10] = {11, 15, 20, 25, 30};
	int *p;
	
	p = &array[2];
	printf("%d\n", *p);			// 20 = array[2]
	printf("%d\n", p[-1]);		// 15 = array[1]
	printf("%d\n", *(p-2));		// 11 = array[1]   *(p-2) = p[-2]
	
	printf("%d\n", array[9]);	// 0
	return 0;
}

int main()
{
	aaa();

	bbb();

	array1();
	array2();
	array3();
	array4();

	array_cal();
	ccc();

	return 0;
}

#if 0
/*
 * arm
 */

/* v8 */
int array1()
{
  400590:	d10703ff 	sub	sp, sp, #0x1c0
	int ar[3][4]  = {{3,2,1,0},{3,2,1,0},{3,2,1,0}}      ; 3*4*4 = 48 byte
  400594:	90000000 	adrp	x0, 400000 <_init-0x3c8> ; parameter
  400598:	91306001 	add	x1, x0, #0xc18               ; x1 : parameter address
  40059c:	910643e0 	add	x0, sp, #0x190               ; x0 : stack point address
  4005a0:	a9400c22 	ldp	x2, x3, [x1]                 ; x1 ---> x2, x3   load data
  4005a4:	a9000c02 	stp	x2, x3, [x0]                 ; x2,x3 ---> x0    save stack
  4005a8:	a9410c22 	ldp	x2, x3, [x1, #16]            ; load 16 byte
  4005ac:	a9010c02 	stp	x2, x3, [x0, #16]            ; save 16 byte
  4005b0:	a9420821 	ldp	x1, x2, [x1, #32]            ; load 32 byte
  4005b4:	a9020801 	stp	x1, x2, [x0, #32]            ; save 32 byte
	int array[100];
	

	array[0] = 1;
  4005b8:	52800020 	mov	w0, #0x1                   	// #1
  4005bc:	b90003e0 	str	w0, [sp]
	array[1] = 1;
  4005c0:	52800020 	mov	w0, #0x1                   	// #1
  4005c4:	b90007e0 	str	w0, [sp, #4]
	array[2] = 1;
  4005c8:	52800020 	mov	w0, #0x1                   	// #1
  4005cc:	b9000be0 	str	w0, [sp, #8]
	array[3] = 1;
  4005d0:	52800020 	mov	w0, #0x1                   	// #1
  4005d4:	b9000fe0 	str	w0, [sp, #12]
	array[4] = 1;
  4005d8:	52800020 	mov	w0, #0x1                   	// #1
  4005dc:	b90013e0 	str	w0, [sp, #16]
	array[5] = 1;
  4005e0:	52800020 	mov	w0, #0x1                   	// #1
  4005e4:	b90017e0 	str	w0, [sp, #20]
	array[6] = 1;
  4005e8:	52800020 	mov	w0, #0x1                   	// #1
  4005ec:	b9001be0 	str	w0, [sp, #24]
	array[7] = 1;
  4005f0:	52800020 	mov	w0, #0x1                   	// #1
  4005f4:	b9001fe0 	str	w0, [sp, #28]
	array[8] = 1;
  4005f8:	52800020 	mov	w0, #0x1                   	// #1
  4005fc:	b90023e0 	str	w0, [sp, #32]
	array[9] = 1;
  400600:	52800020 	mov	w0, #0x1                   	// #1
  400604:	b90027e0 	str	w0, [sp, #36]

}
  400608:	d503201f 	nop
  40060c:	910703ff 	add	sp, sp, #0x1c0
  400610:	d65f03c0 	ret

0000000000400614 <array2>:

int array2()
{
  400614:	d10183ff 	sub	sp, sp, #0x60
	int ar[10];
	int aw[10];
	char ac[10];
}
  400618:	d503201f 	nop
  40061c:	910183ff 	add	sp, sp, #0x60
  400620:	d65f03c0 	ret

0000000000400624 <array3>:

int array3()
{
  400624:	d10183ff 	sub	sp, sp, #0x60
	int ar[10];
	int aw[10];
	char ac[10];

	ar[0] = 100;
  400628:	52800c80 	mov	w0, #0x64                  	// #100
  40062c:	b9003be0 	str	w0, [sp, #56]               ; ar
	aw[0] = 50;
  400630:	52800640 	mov	w0, #0x32                  	// #50
  400634:	b90013e0 	str	w0, [sp, #16]               ; aw
	ac[0] = 'a';
  400638:	52800c20 	mov	w0, #0x61                  	// #97
  40063c:	390003e0 	strb	w0, [sp]                ; ac
	ac[1] = 'b';
  400640:	52800c40 	mov	w0, #0x62                  	// #98
  400644:	390007e0 	strb	w0, [sp, #1]
	ac[2] = 'c';
  400648:	52800c60 	mov	w0, #0x63                  	// #99
  40064c:	39000be0 	strb	w0, [sp, #2]
	ac[3] = 'd';
  400650:	52800c80 	mov	w0, #0x64                  	// #100
  400654:	39000fe0 	strb	w0, [sp, #3]
	ac[4] = 'e';
  400658:	52800ca0 	mov	w0, #0x65                  	// #101
  40065c:	390013e0 	strb	w0, [sp, #4]
	ac[5] = 'f';
  400660:	52800cc0 	mov	w0, #0x66                  	// #102
  400664:	390017e0 	strb	w0, [sp, #5]
	ac[6] = '\0';
  400668:	39001bff 	strb	wzr, [sp, #6]
}
  40066c:	d503201f 	nop
  400670:	910183ff 	add	sp, sp, #0x60
  400674:	d65f03c0 	ret

0000000000400678 <array4>:

void array4()
{
  400678:	d100c3ff 	sub	sp, sp, #0x30
	int ar[3][4];

	ar[0][0] = 1;
  40067c:	52800020 	mov	w0, #0x1                   	// #1
  400680:	b90003e0 	str	w0, [sp]
	ar[0][1] = 2;
  400684:	52800040 	mov	w0, #0x2                   	// #2
  400688:	b90007e0 	str	w0, [sp, #4]
	ar[0][2] = 3;
  40068c:	52800060 	mov	w0, #0x3                   	// #3
  400690:	b9000be0 	str	w0, [sp, #8]
	ar[0][3] = 4;
  400694:	52800080 	mov	w0, #0x4                   	// #4
  400698:	b9000fe0 	str	w0, [sp, #12]
	ar[1][0] = 5;
  40069c:	528000a0 	mov	w0, #0x5                   	// #5
  4006a0:	b90013e0 	str	w0, [sp, #16]
	ar[1][1] = 6;
  4006a4:	528000c0 	mov	w0, #0x6                   	// #6
  4006a8:	b90017e0 	str	w0, [sp, #20]
	ar[1][2] = 7;
  4006ac:	528000e0 	mov	w0, #0x7                   	// #7
  4006b0:	b9001be0 	str	w0, [sp, #24]
	ar[1][3] = 8;
  4006b4:	52800100 	mov	w0, #0x8                   	// #8
  4006b8:	b9001fe0 	str	w0, [sp, #28]
}
  4006bc:	d503201f 	nop
  4006c0:	9100c3ff 	add	sp, sp, #0x30
  4006c4:	d65f03c0 	ret

00000000004006c8 <aaa>:

int sum2d(int ar[][COLS], int rows);
int sum (int ar[], int n);

int aaa()
{
  4006c8:	a9b97bfd 	stp	x29, x30, [sp, #-112]!
  4006cc:	910003fd 	mov	x29, sp
	int total1, total2, total3;
	int *pt1;
	int (*pt2)[COLS];

	pt1 = (int [2]) {10, 20};
  4006d0:	52800140 	mov	w0, #0xa                   	// #10
  4006d4:	b90013a0 	str	w0, [x29, #16]              ; x29+16 = 0xa
  4006d8:	52800280 	mov	w0, #0x14                  	// #20
  4006dc:	b90017a0 	str	w0, [x29, #20]              ; x29+20 = 0x14
  4006e0:	910043a0 	add	x0, x29, #0x10              ; x29 + 0x10
  4006e4:	f90037a0 	str	x0, [x29, #104]             ; pt1
	pt2 = (int [2][COLS]) { {1, 2, 3, -9}, {4, 5, 6,-8} };
  4006e8:	90000000 	adrp	x0, 400000 <_init-0x3c8> ; parameter
  4006ec:	9131e000 	add	x0, x0, #0xc78               ; x0 : parameter address
  4006f0:	910063a2 	add	x2, x29, #0x18               ; x2 : stack point
  4006f4:	aa0003e3 	mov	x3, x0                       ; x3 : parameter address
  4006f8:	a9400460 	ldp	x0, x1, [x3]                 ; x0, x1 <---- [x3]
  4006fc:	a9000440 	stp	x0, x1, [x2]                 ; x0, x1 ----> [x2]
  400700:	a9410460 	ldp	x0, x1, [x3, #16]            ; x0, x1 <---- [x3 + 16]
  400704:	a9010440 	stp	x0, x1, [x2, #16]            ; x0, x1 ----> [x2 + 16]
  400708:	910063a0 	add	x0, x29, #0x18               ; x0 = x29 + 0x18
  40070c:	f90033a0 	str	x0, [x29, #96]               ; pt2

	total1 = sum(pt1, 2);
  400710:	52800041 	mov	w1, #0x2                   	// #2
  400714:	f94037a0 	ldr	x0, [x29, #104]             ; pt1
  400718:	94000021 	bl	40079c <sum>
  40071c:	b9005fa0 	str	w0, [x29, #92] ; total1
	total2 = sum2d(pt2, 2);
  400720:	52800041 	mov	w1, #0x2                   	// #2
  400724:	f94033a0 	ldr	x0, [x29, #96]              ; pt2
  400728:	94000035 	bl	4007fc <sum2d>
  40072c:	b9005ba0 	str	w0, [x29, #88]
	total3 = sum((int[]){4,4,4,5,5,5},6);
  400730:	90000000 	adrp	x0, 400000 <_init-0x3c8> ; x0 : parameter
  400734:	91326000 	add	x0, x0, #0xc98               ; x0 : parameter
  400738:	9100e3a2 	add	x2, x29, #0x38               ; stack point
  40073c:	aa0003e3 	mov	x3, x0                       ; x3 = parameter
  400740:	a9400460 	ldp	x0, x1, [x3] ; x0, x1, <---- x3
  400744:	a9000440 	stp	x0, x1, [x2] ; x0, x1, ----> x2
  400748:	f9400860 	ldr	x0, [x3, #16] ; parameter
  40074c:	f9000840 	str	x0, [x2, #16] ; stack point
  400750:	9100e3a0 	add	x0, x29, #0x38 ; stack size
  400754:	528000c1 	mov	w1, #0x6                   	// #6
  400758:	94000011 	bl	40079c <sum>
  40075c:	b90057a0 	str	w0, [x29, #84] ; total3
	printf("total1 = %d\n", total1);
  400760:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400764:	91312000 	add	x0, x0, #0xc48
  400768:	b9405fa1 	ldr	w1, [x29, #92]
  40076c:	97ffff31 	bl	400430 <printf@plt>
	printf("total2 = %d\n", total2);
  400770:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400774:	91316000 	add	x0, x0, #0xc58
  400778:	b9405ba1 	ldr	w1, [x29, #88]
  40077c:	97ffff2d 	bl	400430 <printf@plt>
	printf("total3 = %d\n", total3);
  400780:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400784:	9131a000 	add	x0, x0, #0xc68
  400788:	b94057a1 	ldr	w1, [x29, #84]
  40078c:	97ffff29 	bl	400430 <printf@plt>
}
  400790:	d503201f 	nop
  400794:	a8c77bfd 	ldp	x29, x30, [sp], #112
  400798:	d65f03c0 	ret

000000000040079c <sum>:

int sum(int ar[], int n)
{
  40079c:	d10083ff 	sub	sp, sp, #0x20
  4007a0:	f90007e0 	str	x0, [sp, #8] ; ar
  4007a4:	b90007e1 	str	w1, [sp, #4] ; n
	int i;
	int total = 0;
  4007a8:	b9001bff 	str	wzr, [sp, #24] ; total

	for (i = 0; i < n; i++)
  4007ac:	b9001fff 	str	wzr, [sp, #28] ; i
  4007b0:	1400000c 	b	4007e0 <sum+0x44>
		total += ar[i];
  4007b4:	b9801fe0 	ldrsw	x0, [sp, #28] ; i
  4007b8:	d37ef400 	lsl	x0, x0, #2        ; i << 2
  4007bc:	f94007e1 	ldr	x1, [sp, #8]      ; ar
  4007c0:	8b000020 	add	x0, x1, x0        ; ar = ar + i
  4007c4:	b9400000 	ldr	w0, [x0]          ; ar[i]
  4007c8:	b9401be1 	ldr	w1, [sp, #24]     ; total
  4007cc:	0b000020 	add	w0, w1, w0        ; total + ar[i]
  4007d0:	b9001be0 	str	w0, [sp, #24]     ; total
	for (i = 0; i < n; i++)
  4007d4:	b9401fe0 	ldr	w0, [sp, #28] ; i
  4007d8:	11000400 	add	w0, w0, #0x1  ; i+1
  4007dc:	b9001fe0 	str	w0, [sp, #28] ; i
  4007e0:	b9401fe1 	ldr	w1, [sp, #28] ; i
  4007e4:	b94007e0 	ldr	w0, [sp, #4]  ; n
  4007e8:	6b00003f 	cmp	w1, w0
  4007ec:	54fffe4b 	b.lt	4007b4 <sum+0x18>  // b.tstop

	return total;
  4007f0:	b9401be0 	ldr	w0, [sp, #24] ; total
}
  4007f4:	910083ff 	add	sp, sp, #0x20
  4007f8:	d65f03c0 	ret

00000000004007fc <sum2d>:

int sum2d(int ar[][COLS], int rows)
{
  4007fc:	d10083ff 	sub	sp, sp, #0x20
  400800:	f90007e0 	str	x0, [sp, #8] ; ar
  400804:	b90007e1 	str	w1, [sp, #4] ; rows
	int r;
	int c;
	int tot = 0;
  400808:	b90017ff 	str	wzr, [sp, #20] ; tot

	for (r = 0; r < rows; r++)
  40080c:	b9001fff 	str	wzr, [sp, #28] ; r
  400810:	14000015 	b	400864 <sum2d+0x68>
		for (c = 0; c < COLS; c++)
  400814:	b9001bff 	str	wzr, [sp, #24] ; c
  400818:	1400000d 	b	40084c <sum2d+0x50>
			tot += ar[r][c];
  40081c:	b9801fe0 	ldrsw	x0, [sp, #28] ; r
  400820:	d37cec00 	lsl	x0, x0, #4        ; r << 4
  400824:	f94007e1 	ldr	x1, [sp, #8]      ; ar
  400828:	8b000020 	add	x0, x1, x0        ; r<<4 + ar
  40082c:	b9801be1 	ldrsw	x1, [sp, #24] ; x1 = c
  400830:	b8617800 	ldr	w0, [x0, x1, lsl #2] ; w0 = (r<<4)+ar + c^2
  400834:	b94017e1 	ldr	w1, [sp, #20]        ; tot
  400838:	0b000020 	add	w0, w1, w0           ; w0 = tot + ar[i]
  40083c:	b90017e0 	str	w0, [sp, #20]        ; tot
		for (c = 0; c < COLS; c++)
  400840:	b9401be0 	ldr	w0, [sp, #24] ; c
  400844:	11000400 	add	w0, w0, #0x1  ; c + 1
  400848:	b9001be0 	str	w0, [sp, #24] ; c
  40084c:	b9401be0 	ldr	w0, [sp, #24] ; c
  400850:	71000c1f 	cmp	w0, #0x3
  400854:	54fffe4d 	b.le	40081c <sum2d+0x20>
	for (r = 0; r < rows; r++)
  400858:	b9401fe0 	ldr	w0, [sp, #28] ; r 
  40085c:	11000400 	add	w0, w0, #0x1  ; r = r+1
  400860:	b9001fe0 	str	w0, [sp, #28] ; save r
  400864:	b9401fe1 	ldr	w1, [sp, #28] ; load r
  400868:	b94007e0 	ldr	w0, [sp, #4]  ; rows
  40086c:	6b00003f 	cmp	w1, w0
  400870:	54fffd2b 	b.lt	400814 <sum2d+0x18>  // b.tstop

	return tot;
  400874:	b94017e0 	ldr	w0, [sp, #20]
}
  400878:	910083ff 	add	sp, sp, #0x20
  40087c:	d65f03c0 	ret

0000000000400880 <bbb>:

int bbb()
{
  400880:	a9ba7bfd 	stp	x29, x30, [sp, #-96]!
  400884:	910003fd 	mov	x29, sp
  400888:	a90153f3 	stp	x19, x20, [sp, #16]
  40088c:	a9025bf5 	stp	x21, x22, [sp, #32]
  400890:	f9001bf7 	str	x23, [sp, #48]
  400894:	910003f4 	mov	x20, sp
  400898:	aa1403f7 	mov	x23, x20
	int row = 3, col = 4;
  40089c:	52800074 	mov	w20, #0x3                   	// #3
  4008a0:	b9005fb4 	str	w20, [x29, #92]
  4008a4:	52800094 	mov	w20, #0x4                   	// #4
  4008a8:	b9005bb4 	str	w20, [x29, #88]
	int ary[row][col];
  4008ac:	b9405bb4 	ldr	w20, [x29, #88]
  4008b0:	b9405fb5 	ldr	w21, [x29, #92]
  4008b4:	93407e96 	sxtw	x22, w20
  4008b8:	d10006d6 	sub	x22, x22, #0x1
  4008bc:	f9002bb6 	str	x22, [x29, #80]
  4008c0:	93407e96 	sxtw	x22, w20
  4008c4:	aa1603f2 	mov	x18, x22
  4008c8:	d2800013 	mov	x19, #0x0                   	// #0
  4008cc:	d37bfe56 	lsr	x22, x18, #59
  4008d0:	d37bea6d 	lsl	x13, x19, #5
  4008d4:	aa0d02cd 	orr	x13, x22, x13
  4008d8:	d37bea4c 	lsl	x12, x18, #5
  4008dc:	93407eac 	sxtw	x12, w21
  4008e0:	d100058c 	sub	x12, x12, #0x1
  4008e4:	f90027ac 	str	x12, [x29, #72]
  4008e8:	93407e8c 	sxtw	x12, w20
  4008ec:	aa0c03e6 	mov	x6, x12
  4008f0:	d2800007 	mov	x7, #0x0                   	// #0
  4008f4:	93407eac 	sxtw	x12, w21
  4008f8:	aa0c03e4 	mov	x4, x12
  4008fc:	d2800005 	mov	x5, #0x0                   	// #0
  400900:	9b047ccd 	mul	x13, x6, x4
  400904:	9bc47ccc 	umulh	x12, x6, x4
  400908:	9b0430ec 	madd	x12, x7, x4, x12
  40090c:	9b0530cc 	madd	x12, x6, x5, x12
  400910:	aa0d03f0 	mov	x16, x13
  400914:	aa0c03f1 	mov	x17, x12
  400918:	d37bfe04 	lsr	x4, x16, #59
  40091c:	d37bea2b 	lsl	x11, x17, #5
  400920:	aa0b008b 	orr	x11, x4, x11
  400924:	d37bea0a 	lsl	x10, x16, #5
  400928:	93407e84 	sxtw	x4, w20
  40092c:	aa0403e2 	mov	x2, x4
  400930:	d2800003 	mov	x3, #0x0                   	// #0
  400934:	93407ea4 	sxtw	x4, w21
  400938:	aa0403e0 	mov	x0, x4
  40093c:	d2800001 	mov	x1, #0x0                   	// #0
  400940:	9b007c45 	mul	x5, x2, x0
  400944:	9bc07c44 	umulh	x4, x2, x0
  400948:	9b001064 	madd	x4, x3, x0, x4
  40094c:	9b011044 	madd	x4, x2, x1, x4
  400950:	aa0503ee 	mov	x14, x5
  400954:	aa0403ef 	mov	x15, x4
  400958:	d37bfdc0 	lsr	x0, x14, #59
  40095c:	d37be9e9 	lsl	x9, x15, #5
  400960:	aa090009 	orr	x9, x0, x9
  400964:	d37be9c8 	lsl	x8, x14, #5
  400968:	93407e81 	sxtw	x1, w20
  40096c:	93407ea0 	sxtw	x0, w21
  400970:	9b007c20 	mul	x0, x1, x0
  400974:	d37ef400 	lsl	x0, x0, #2
  400978:	91000c00 	add	x0, x0, #0x3
  40097c:	91003c00 	add	x0, x0, #0xf
  400980:	d344fc00 	lsr	x0, x0, #4
  400984:	d37cec00 	lsl	x0, x0, #4
  400988:	cb2063ff 	sub	sp, sp, x0
  40098c:	910003e0 	mov	x0, sp
  400990:	91000c00 	add	x0, x0, #0x3
  400994:	d342fc00 	lsr	x0, x0, #2
  400998:	d37ef400 	lsl	x0, x0, #2
  40099c:	f90023a0 	str	x0, [x29, #64]
  4009a0:	910002ff 	mov	sp, x23
	
	int array(int col, int row, int ary[col][row]);
	int arra2(int ary[col][row], int col, int row);	// not VLA
	
}
  4009a4:	d503201f 	nop
  4009a8:	910003bf 	mov	sp, x29
  4009ac:	a94153f3 	ldp	x19, x20, [sp, #16]
  4009b0:	a9425bf5 	ldp	x21, x22, [sp, #32]
  4009b4:	f9401bf7 	ldr	x23, [sp, #48]
  4009b8:	a8c67bfd 	ldp	x29, x30, [sp], #96
  4009bc:	d65f03c0 	ret

00000000004009c0 <array_cal>:

int array_cal(void)
{
  4009c0:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  4009c4:	910003fd 	mov	x29, sp
	int a[5]={1,2,3,4,9};
  4009c8:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  4009cc:	91342000 	add	x0, x0, #0xd08
  4009d0:	910063a2 	add	x2, x29, #0x18
  4009d4:	aa0003e3 	mov	x3, x0
  4009d8:	a9400460 	ldp	x0, x1, [x3]
  4009dc:	a9000440 	stp	x0, x1, [x2]
  4009e0:	b9401060 	ldr	w0, [x3, #16]
  4009e4:	b9001040 	str	w0, [x2, #16]
	int *ptr1 = (int*)(&a + 1);
  4009e8:	910063a0 	add	x0, x29, #0x18 ; &a+1
  4009ec:	91005000 	add	x0, x0, #0x14  ; 
  4009f0:	f9001fa0 	str	x0, [x29, #56] ; ptr1
	int *ptr2 = (int*)((int)a + 1);
  4009f4:	910063a0 	add	x0, x29, #0x18
  4009f8:	11000400 	add	w0, w0, #0x1
  4009fc:	93407c00 	sxtw	x0, w0
  400a00:	f9001ba0 	str	x0, [x29, #48] ; ptr2
	int temp = (int)(&a + 1 );	// &a+1 = &a + sizeof(a) = &a + 5 * sizeof(int),也就是下一个数组的首地址.
  400a04:	910063a0 	add	x0, x29, #0x18 ; &a + 1
  400a08:	91005000 	add	x0, x0, #0x14
  400a0c:	b9002fa0 	str	w0, [x29, #44] ; temp

	//printf("temp - : %d, 0x%x, %x, 0x%x\n", temp, *ptr1, ptr1[-1], *ptr2);
	printf("temp - : 0x%x\n", temp);		// 0xe369b1d4
  400a10:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a14:	9132c000 	add	x0, x0, #0xcb0
  400a18:	b9402fa1 	ldr	w1, [x29, #44]
  400a1c:	97fffe85 	bl	400430 <printf@plt>
	printf("temp - : 0x%x, \n", *ptr1);		// 0
  400a20:	f9401fa0 	ldr	x0, [x29, #56]
  400a24:	b9400001 	ldr	w1, [x0]
  400a28:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a2c:	91330000 	add	x0, x0, #0xcc0
  400a30:	97fffe80 	bl	400430 <printf@plt>
	printf("temp - %p, \n", *ptr1);			// (nil)
  400a34:	f9401fa0 	ldr	x0, [x29, #56]
  400a38:	b9400001 	ldr	w1, [x0]
  400a3c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a40:	91336000 	add	x0, x0, #0xcd8
  400a44:	97fffe7b 	bl	400430 <printf@plt>
	printf("temp - %p, \n", ptr1);			// 0x7ffee369b1d4
  400a48:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a4c:	91336000 	add	x0, x0, #0xcd8
  400a50:	f9401fa1 	ldr	x1, [x29, #56] ; ptr1
  400a54:	97fffe77 	bl	400430 <printf@plt>
	printf("temp - : 0x%x\n", ptr1[-1]);	// 9	
  400a58:	f9401fa0 	ldr	x0, [x29, #56]
  400a5c:	d1001000 	sub	x0, x0, #0x4
  400a60:	b9400001 	ldr	w1, [x0] ; ptr1[-1]
  400a64:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a68:	9132c000 	add	x0, x0, #0xcb0
  400a6c:	97fffe71 	bl	400430 <printf@plt>

	//printf("temp - : 0x%x\n", *ptr2);		// Segmentation fault
	//printf("temp - %p, \n", *ptr2);		// Segmentation fault
	printf("temp - %p, \n", ptr2);			// 0xffffffffe369b1c1
  400a70:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a74:	91336000 	add	x0, x0, #0xcd8
  400a78:	f9401ba1 	ldr	x1, [x29, #48]
  400a7c:	97fffe6d 	bl	400430 <printf@plt>

	printf("temp = %x\n", temp);			//   e369b1d4
  400a80:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a84:	9133a000 	add	x0, x0, #0xce8
  400a88:	b9402fa1 	ldr	w1, [x29, #44]
  400a8c:	97fffe69 	bl	400430 <printf@plt>
	printf("temp = %p\n", temp);			// 0xe369b1d4		
  400a90:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400a94:	9133e000 	add	x0, x0, #0xcf8
  400a98:	b9402fa1 	ldr	w1, [x29, #44]
  400a9c:	97fffe65 	bl	400430 <printf@plt>

	return 0;
  400aa0:	52800000 	mov	w0, #0x0                   	// #0
}
  400aa4:	a8c47bfd 	ldp	x29, x30, [sp], #64
  400aa8:	d65f03c0 	ret

0000000000400aac <ccc>:


int ccc(void)
{
  400aac:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
  400ab0:	910003fd 	mov	x29, sp
	int array[10] = {11, 15, 20, 25, 30};
  400ab4:	a9017fbf 	stp	xzr, xzr, [x29, #16]
  400ab8:	a9027fbf 	stp	xzr, xzr, [x29, #32]
  400abc:	f9001bbf 	str	xzr, [x29, #48]
  400ac0:	52800160 	mov	w0, #0xb                   	// #11
  400ac4:	b90013a0 	str	w0, [x29, #16]
  400ac8:	528001e0 	mov	w0, #0xf                   	// #15
  400acc:	b90017a0 	str	w0, [x29, #20]
  400ad0:	52800280 	mov	w0, #0x14                  	// #20
  400ad4:	b9001ba0 	str	w0, [x29, #24]
  400ad8:	52800320 	mov	w0, #0x19                  	// #25
  400adc:	b9001fa0 	str	w0, [x29, #28]
  400ae0:	528003c0 	mov	w0, #0x1e                  	// #30
  400ae4:	b90023a0 	str	w0, [x29, #32]
	int *p;
	
	p = &array[2];
  400ae8:	910043a0 	add	x0, x29, #0x10 ; array
  400aec:	91002000 	add	x0, x0, #0x8   ; array[8/4=2]
  400af0:	f9001fa0 	str	x0, [x29, #56] ; p
	printf("%d\n", *p);			// 20 = array[2]
  400af4:	f9401fa0 	ldr	x0, [x29, #56] ; p
  400af8:	b9400001 	ldr	w1, [x0]       ; *p
  400afc:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400b00:	91348000 	add	x0, x0, #0xd20
  400b04:	97fffe4b 	bl	400430 <printf@plt>
	printf("%d\n", p[-1]);		// 15 = array[1]
  400b08:	f9401fa0 	ldr	x0, [x29, #56] ; p
  400b0c:	d1001000 	sub	x0, x0, #0x4 ; array[4/4] = array[1]
  400b10:	b9400001 	ldr	w1, [x0]
  400b14:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400b18:	91348000 	add	x0, x0, #0xd20
  400b1c:	97fffe45 	bl	400430 <printf@plt>
	printf("%d\n", *(p-2));		// 11 = array[1]   *(p-2) = p[-2]
  400b20:	f9401fa0 	ldr	x0, [x29, #56]
  400b24:	d1002000 	sub	x0, x0, #0x8 ; p - 8 
  400b28:	b9400001 	ldr	w1, [x0]
  400b2c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400b30:	91348000 	add	x0, x0, #0xd20
  400b34:	97fffe3f 	bl	400430 <printf@plt>
	
	printf("%d\n", array[9]);	// 0
  400b38:	b94037a1 	ldr	w1, [x29, #52] ; array
  400b3c:	90000000 	adrp	x0, 400000 <_init-0x3c8>
  400b40:	91348000 	add	x0, x0, #0xd20
  400b44:	97fffe3b 	bl	400430 <printf@plt>
	return 0;
  400b48:	52800000 	mov	w0, #0x0                   	// #0
}
  400b4c:	a8c47bfd 	ldp	x29, x30, [sp], #64
  400b50:	d65f03c0 	ret

0000000000400b54 <main>:

int main()
{
  400b54:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
  400b58:	910003fd 	mov	x29, sp
	array1();
  400b5c:	97fffe8d 	bl	400590 <array1>
	array2();
  400b60:	97fffead 	bl	400614 <array2>
	array3();
  400b64:	97fffeb0 	bl	400624 <array3>
	array4();
  400b68:	97fffec4 	bl	400678 <array4>

	array_cal();
  400b6c:	97ffff95 	bl	4009c0 <array_cal>
	ccc();
  400b70:	97ffffcf 	bl	400aac <ccc>

	return 0;
  400b74:	52800000 	mov	w0, #0x0                   	// #0
}
  400b78:	a8c17bfd 	ldp	x29, x30, [sp], #16
  400b7c:	d65f03c0 	ret

/* v7 */
int array1()
{
   10490:	e92d4800 	push	{fp, lr}
   10494:	e28db004 	add	fp, sp, #4
   10498:	e24ddd07 	sub	sp, sp, #448	; 0x1c0     100*4 + 12*4 = 448
	int ar[3][4]  = {{3,2,1,0},{3,2,1,0},{3,2,1,0}};
   1049c:	e59f3078 	ldr	r3, [pc, #120]	; 1051c <array1+0x8c>   variable value
   104a0:	e24bc034 	sub	ip, fp, #52	; 0x34  ar
   104a4:	e1a0e003 	mov	lr, r3      ; lr = variable value
   104a8:	e8be000f 	ldm	lr!, {r0, r1, r2, r3} ; lr=r0=3, lr+4=r1=2, lr+8=r2=1, lr+12=r3=0 
   104ac:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3} ; ip=r0=3, ip+4=r1=2, ip+8=r2=1, ip+12=r3=0
   104b0:	e8be000f 	ldm	lr!, {r0, r1, r2, r3}     ; lr=r0=3, lr+4=r1=2, lr+8=r2=1, lr+12=r3=0
   104b4:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3} ; ip=r0=3, ip+4=r1=2, ip+8=r2=1, ip+12=r3=0
   104b8:	e89e000f 	ldm	lr, {r0, r1, r2, r3} ; lr=r0=3, lr+4=r1=2, lr+8=r2=1, lr+12=r3=0
   104bc:	e88c000f 	stm	ip, {r0, r1, r2, r3} ; ip=r0=3, ip+4=r1=2, ip+8=r2=1, ip+12=r3=0xx
	int array[100];
	

	array[0] = 1;
   104c0:	e3a03001 	mov	r3, #1
   104c4:	e50b31c4 	str	r3, [fp, #-452]	; 0xfffffe3c
	array[1] = 1;
   104c8:	e3a03001 	mov	r3, #1
   104cc:	e50b31c0 	str	r3, [fp, #-448]	; 0xfffffe40
	array[2] = 1;
   104d0:	e3a03001 	mov	r3, #1
   104d4:	e50b31bc 	str	r3, [fp, #-444]	; 0xfffffe44
	array[3] = 1;
   104d8:	e3a03001 	mov	r3, #1
   104dc:	e50b31b8 	str	r3, [fp, #-440]	; 0xfffffe48
	array[4] = 1;
   104e0:	e3a03001 	mov	r3, #1
   104e4:	e50b31b4 	str	r3, [fp, #-436]	; 0xfffffe4c
	array[5] = 1;
   104e8:	e3a03001 	mov	r3, #1
   104ec:	e50b31b0 	str	r3, [fp, #-432]	; 0xfffffe50
	array[6] = 1;
   104f0:	e3a03001 	mov	r3, #1
   104f4:	e50b31ac 	str	r3, [fp, #-428]	; 0xfffffe54
	array[7] = 1;
   104f8:	e3a03001 	mov	r3, #1
   104fc:	e50b31a8 	str	r3, [fp, #-424]	; 0xfffffe58
	array[8] = 1;
   10500:	e3a03001 	mov	r3, #1
   10504:	e50b31a4 	str	r3, [fp, #-420]	; 0xfffffe5c
	array[9] = 1;
   10508:	e3a03001 	mov	r3, #1
   1050c:	e50b31a0 	str	r3, [fp, #-416]	; 0xfffffe60

}
   10510:	e1a00003 	mov	r0, r3
   10514:	e24bd004 	sub	sp, fp, #4
   10518:	e8bd8800 	pop	{fp, pc}
   1051c:	00010c5c 	.word	0x00010c5c

00010520 <array2>:

int array2()
{
   10520:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
   10524:	e28db000 	add	fp, sp, #0
   10528:	e24dd064 	sub	sp, sp, #100	; 0x64  (10+10)*4=80
	int ar[10];
	int aw[10];
	char ac[10];
}
   1052c:	e1a00003 	mov	r0, r3
   10530:	e24bd000 	sub	sp, fp, #0
   10534:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
   10538:	e12fff1e 	bx	lr

0001053c <array3>:

int array3()
{
   1053c:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
   10540:	e28db000 	add	fp, sp, #0
   10544:	e24dd064 	sub	sp, sp, #100	; 0x64
	int ar[10];
	int aw[10];
	char ac[10];

	ar[0] = 100;
   10548:	e3a03064 	mov	r3, #100	; 0x64
   1054c:	e50b302c 	str	r3, [fp, #-44]	; 0xffffffd4    ar
	aw[0] = 50;
   10550:	e3a03032 	mov	r3, #50	; 0x32
   10554:	e50b3054 	str	r3, [fp, #-84]	; 0xffffffac    aw
	ac[0] = 'a';
   10558:	e3a03061 	mov	r3, #97	; 0x61
   1055c:	e54b3060 	strb	r3, [fp, #-96]	; 0xffffffa0    ac
	ac[1] = 'b';
   10560:	e3a03062 	mov	r3, #98	; 0x62
   10564:	e54b305f 	strb	r3, [fp, #-95]	; 0xffffffa1
	ac[2] = 'c';
   10568:	e3a03063 	mov	r3, #99	; 0x63
   1056c:	e54b305e 	strb	r3, [fp, #-94]	; 0xffffffa2
	ac[3] = 'd';
   10570:	e3a03064 	mov	r3, #100	; 0x64
   10574:	e54b305d 	strb	r3, [fp, #-93]	; 0xffffffa3
	ac[4] = 'e';
   10578:	e3a03065 	mov	r3, #101	; 0x65
   1057c:	e54b305c 	strb	r3, [fp, #-92]	; 0xffffffa4
	ac[5] = 'f';
   10580:	e3a03066 	mov	r3, #102	; 0x66
   10584:	e54b305b 	strb	r3, [fp, #-91]	; 0xffffffa5
	ac[6] = '\0';
   10588:	e3a03000 	mov	r3, #0
   1058c:	e54b305a 	strb	r3, [fp, #-90]	; 0xffffffa6
}
   10590:	e1a00003 	mov	r0, r3
   10594:	e24bd000 	sub	sp, fp, #0
   10598:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
   1059c:	e12fff1e 	bx	lr

000105a0 <array4>:

void array4()
{
   105a0:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
   105a4:	e28db000 	add	fp, sp, #0
   105a8:	e24dd034 	sub	sp, sp, #52	; 0x34
	int ar[3][4];

	ar[0][0] = 1;
   105ac:	e3a03001 	mov	r3, #1
   105b0:	e50b3034 	str	r3, [fp, #-52]	; 0xffffffcc    ar[0][0]
	ar[0][1] = 2;
   105b4:	e3a03002 	mov	r3, #2
   105b8:	e50b3030 	str	r3, [fp, #-48]	; 0xffffffd0
	ar[0][2] = 3;
   105bc:	e3a03003 	mov	r3, #3
   105c0:	e50b302c 	str	r3, [fp, #-44]	; 0xffffffd4
	ar[0][3] = 4;
   105c4:	e3a03004 	mov	r3, #4
   105c8:	e50b3028 	str	r3, [fp, #-40]	; 0xffffffd8
	ar[1][0] = 5;
   105cc:	e3a03005 	mov	r3, #5
   105d0:	e50b3024 	str	r3, [fp, #-36]	; 0xffffffdc    ar[1][0]
	ar[1][1] = 6;
   105d4:	e3a03006 	mov	r3, #6
   105d8:	e50b3020 	str	r3, [fp, #-32]	; 0xffffffe0
	ar[1][2] = 7;
   105dc:	e3a03007 	mov	r3, #7
   105e0:	e50b301c 	str	r3, [fp, #-28]	; 0xffffffe4
	ar[1][3] = 8;
   105e4:	e3a03008 	mov	r3, #8
   105e8:	e50b3018 	str	r3, [fp, #-24]	; 0xffffffe8
}
   105ec:	e24bd000 	sub	sp, fp, #0
   105f0:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
   105f4:	e12fff1e 	bx	lr

000105f8 <aaa>:

int sum2d(int ar[][COLS], int rows);
int sum (int ar[], int n);

int aaa()
{
   105f8:	e92d4800 	push	{fp, lr}
   105fc:	e28db004 	add	fp, sp, #4
   10600:	e24dd058 	sub	sp, sp, #88	; 0x58
	int total1, total2, total3;
	int *pt1;
	int (*pt2)[COLS];

	pt1 = (int [2]) {10, 20};
   10604:	e59f20b4 	ldr	r2, [pc, #180]	; 106c0 <aaa+0xc8>  parameter
   10608:	e24b3058 	sub	r3, fp, #88	; 0x58  r3=fp-88
   1060c:	e8920003 	ldm	r2, {r0, r1} ; r0=r2=10, r1=r2+4=20
   10610:	e8830003 	stm	r3, {r0, r1} ; r3=r0=10, r3+4=r1=20
   10614:	e24b3058 	sub	r3, fp, #88	; 0x58
   10618:	e50b3008 	str	r3, [fp, #-8]                 ; pt1=fp-8 ---> fp-88    note:pointer
	pt2 = (int [2][COLS]) { {1, 2, 3, -9}, {4, 5, 6,-8} };
   1061c:	e59f30a0 	ldr	r3, [pc, #160]	; 106c4 <aaa+0xcc>  parameter
   10620:	e24bc050 	sub	ip, fp, #80	; 0x50  ip=fp-80
   10624:	e1a0e003 	mov	lr, r3      ; lr = paramter address
   10628:	e8be000f 	ldm	lr!, {r0, r1, r2, r3} ; r0=lr=1, r1=lr+4=2, r2=lr+8=3, r3=lr+12=-9
   1062c:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3} ; ip=r0=1, ip+4=r1=2, ip+8=r2=3, ip+12=r3=-9
   10630:	e89e000f 	ldm	lr, {r0, r1, r2, r3}      ; r0=lr=4, r1=lr+4=5, r2=lr+8=6, r3=lr+12=-8
   10634:	e88c000f 	stm	ip, {r0, r1, r2, r3}      ; ip=r0=4, ip+4=r1=5, ip+8=r2=6, r3=lr+12=-8
   10638:	e24b3050 	sub	r3, fp, #80	; 0x50  variable address
   1063c:	e50b300c 	str	r3, [fp, #-12] ; pt2 = fp-12 ---> fp-80 point to variable.  note:pointer

	total1 = sum(pt1, 2);
   10640:	e3a01002 	mov	r1, #2
   10644:	e51b0008 	ldr	r0, [fp, #-8] ; pt1
   10648:	eb000022 	bl	106d8 <sum>
   1064c:	e50b0010 	str	r0, [fp, #-16] ; total1
	total2 = sum2d(pt2, 2);
   10650:	e3a01002 	mov	r1, #2
   10654:	e51b000c 	ldr	r0, [fp, #-12] ; pt2
   10658:	eb00003c 	bl	10750 <sum2d>
   1065c:	e50b0014 	str	r0, [fp, #-20]	; 0xffffffec    total2
	total3 = sum((int[]){4,4,4,5,5,5},6);
   10660:	e59f3060 	ldr	r3, [pc, #96]	; 106c8 <aaa+0xd0>  parameter
   10664:	e24bc030 	sub	ip, fp, #48	; 0x30 variable address
   10668:	e1a0e003 	mov	lr, r3      ; lr = parameter address
   1066c:	e8be000f 	ldm	lr!, {r0, r1, r2, r3} ; r0=lr=4, r1=lr+4=4, r2=lr+8=4, r3=lr+12=5
   10670:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3} ; ip=r0=4, ip+4=r1=4, ip+8=r2, ip+12=r3=5
   10674:	e89e0003 	ldm	lr, {r0, r1}              ; r0=lr=5, r1=lr+4=5
   10678:	e88c0003 	stm	ip, {r0, r1}              ; ip=r0=5, ip+4=r1=5
   1067c:	e24b3030 	sub	r3, fp, #48	; 0x30          variable address
   10680:	e3a01006 	mov	r1, #6      ; second parameter
   10684:	e1a00003 	mov	r0, r3      ; variable address
   10688:	eb000012 	bl	106d8 <sum>
   1068c:	e50b0018 	str	r0, [fp, #-24]	; 0xffffffe8   total3 = sum return value 
	printf("total1 = %d\n", total1);
   10690:	e51b1010 	ldr	r1, [fp, #-16] ; total1
   10694:	e59f0030 	ldr	r0, [pc, #48]	; 106cc <aaa+0xd4>
   10698:	ebffff1c 	bl	10310 <printf@plt>
	printf("total2 = %d\n", total2);
   1069c:	e51b1014 	ldr	r1, [fp, #-20]	; 0xffffffec    total2
   106a0:	e59f0028 	ldr	r0, [pc, #40]	; 106d0 <aaa+0xd8>  
   106a4:	ebffff19 	bl	10310 <printf@plt>
	printf("total3 = %d\n", total3);
   106a8:	e51b1018 	ldr	r1, [fp, #-24]	; 0xffffffe8    total3
   106ac:	e59f0020 	ldr	r0, [pc, #32]	; 106d4 <aaa+0xdc>
   106b0:	ebffff16 	bl	10310 <printf@plt>
}
   106b4:	e1a00003 	mov	r0, r3
   106b8:	e24bd004 	sub	sp, fp, #4
   106bc:	e8bd8800 	pop	{fp, pc}
   106c0:	00010cbc 	.word	0x00010cbc
   106c4:	00010cc4 	.word	0x00010cc4
   106c8:	00010ce4 	.word	0x00010ce4
   106cc:	00010c8c 	.word	0x00010c8c
   106d0:	00010c9c 	.word	0x00010c9c
   106d4:	00010cac 	.word	0x00010cac

000106d8 <sum>:

int sum(int ar[], int n)
{
   106d8:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
   106dc:	e28db000 	add	fp, sp, #0
   106e0:	e24dd014 	sub	sp, sp, #20
   106e4:	e50b0010 	str	r0, [fp, #-16] ; ar
   106e8:	e50b1014 	str	r1, [fp, #-20]	; 0xffffffec    n
	int i;
	int total = 0;
   106ec:	e3a03000 	mov	r3, #0
   106f0:	e50b300c 	str	r3, [fp, #-12] ; total

	for (i = 0; i < n; i++)
   106f4:	e3a03000 	mov	r3, #0
   106f8:	e50b3008 	str	r3, [fp, #-8] ; i
   106fc:	ea00000a 	b	1072c <sum+0x54>
		total += ar[i];
   10700:	e51b3008 	ldr	r3, [fp, #-8] ; i
   10704:	e1a03103 	lsl	r3, r3, #2    ; i << 2 = 4
   10708:	e51b2010 	ldr	r2, [fp, #-16] ; ar
   1070c:	e0823003 	add	r3, r2, r3     ; ar+4, ar[0], ar[1]...
   10710:	e5933000 	ldr	r3, [r3]       ; get a[i] value
   10714:	e51b200c 	ldr	r2, [fp, #-12] ; total
   10718:	e0823003 	add	r3, r2, r3     ; total+a[i]
   1071c:	e50b300c 	str	r3, [fp, #-12] ; total
	for (i = 0; i < n; i++)
   10720:	e51b3008 	ldr	r3, [fp, #-8] ; i
   10724:	e2833001 	add	r3, r3, #1    ; i + 1
   10728:	e50b3008 	str	r3, [fp, #-8] ; save i
   1072c:	e51b2008 	ldr	r2, [fp, #-8] ; i
   10730:	e51b3014 	ldr	r3, [fp, #-20]	; 0xffffffec    n
   10734:	e1520003 	cmp	r2, r3
   10738:	bafffff0 	blt	10700 <sum+0x28>

	return total;
   1073c:	e51b300c 	ldr	r3, [fp, #-12] ; total
}
   10740:	e1a00003 	mov	r0, r3
   10744:	e24bd000 	sub	sp, fp, #0
   10748:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
   1074c:	e12fff1e 	bx	lr

00010750 <sum2d>:

int sum2d(int ar[][COLS], int rows)
{
   10750:	e52db004 	push	{fp}		; (str fp, [sp, #-4]!)
   10754:	e28db000 	add	fp, sp, #0
   10758:	e24dd01c 	sub	sp, sp, #28
   1075c:	e50b0018 	str	r0, [fp, #-24]	; 0xffffffe8    ar
   10760:	e50b101c 	str	r1, [fp, #-28]	; 0xffffffe4    rows
	int r;
	int c;
	int tot = 0;
   10764:	e3a03000 	mov	r3, #0
   10768:	e50b3010 	str	r3, [fp, #-16] ; tot

	for (r = 0; r < rows; r++)
   1076c:	e3a03000 	mov	r3, #0
   10770:	e50b3008 	str	r3, [fp, #-8] ; r
   10774:	ea000014 	b	107cc <sum2d+0x7c>
		for (c = 0; c < COLS; c++)
   10778:	e3a03000 	mov	r3, #0
   1077c:	e50b300c 	str	r3, [fp, #-12] ; c
   10780:	ea00000b 	b	107b4 <sum2d+0x64>
			tot += ar[r][c];
   10784:	e51b3008 	ldr	r3, [fp, #-8] ; r
   10788:	e1a03203 	lsl	r3, r3, #4    ; r = 2^4 = 16
   1078c:	e51b2018 	ldr	r2, [fp, #-24]	; 0xffffffe8    rows
   10790:	e0823003 	add	r3, r2, r3      ; r = rows address + 16 
   10794:	e51b200c 	ldr	r2, [fp, #-12]  ; c
   10798:	e7933102 	ldr	r3, [r3, r2, lsl #2] ; (rows address+16)+c^2    
   1079c:	e51b2010 	ldr	r2, [fp, #-16]       ; tot
   107a0:	e0823003 	add	r3, r2, r3           ; tot+r3
   107a4:	e50b3010 	str	r3, [fp, #-16] ; tot
		for (c = 0; c < COLS; c++)
   107a8:	e51b300c 	ldr	r3, [fp, #-12] ; c
   107ac:	e2833001 	add	r3, r3, #1     ; c+1
   107b0:	e50b300c 	str	r3, [fp, #-12] ; c
   107b4:	e51b300c 	ldr	r3, [fp, #-12] ; c
   107b8:	e3530003 	cmp	r3, #3
   107bc:	dafffff0 	ble	10784 <sum2d+0x34>
	for (r = 0; r < rows; r++)
   107c0:	e51b3008 	ldr	r3, [fp, #-8] ; r
   107c4:	e2833001 	add	r3, r3, #1    ; r3 + 1
   107c8:	e50b3008 	str	r3, [fp, #-8] ; r
   107cc:	e51b2008 	ldr	r2, [fp, #-8] ; r 
   107d0:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4 rows
   107d4:	e1520003 	cmp	r2, r3
   107d8:	baffffe6 	blt	10778 <sum2d+0x28>

	return tot;
   107dc:	e51b3010 	ldr	r3, [fp, #-16] ; tot
}
   107e0:	e1a00003 	mov	r0, r3
   107e4:	e24bd000 	sub	sp, fp, #0
   107e8:	e49db004 	pop	{fp}		; (ldr fp, [sp], #4)
   107ec:	e12fff1e 	bx	lr

000107f0 <bbb>:

int bbb()
{
   107f0:	e92d4ff0 	push	{r4, r5, r6, r7, r8, r9, sl, fp, lr}
   107f4:	e28db020 	add	fp, sp, #32
   107f8:	e24dd024 	sub	sp, sp, #36	; 0x24
   107fc:	e1a0c00d 	mov	ip, sp
   10800:	e50bc040 	str	ip, [fp, #-64]	; 0xffffffc0
	int row = 3, col = 4;
   10804:	e3a0c003 	mov	ip, #3
   10808:	e50bc028 	str	ip, [fp, #-40]	; 0xffffffd8 row
   1080c:	e3a0c004 	mov	ip, #4
   10810:	e50bc02c 	str	ip, [fp, #-44]	; 0xffffffd4 col
	int ary[row][col];
   10814:	e51bc02c 	ldr	ip, [fp, #-44]	; 0xffffffd4    col
   10818:	e51be028 	ldr	lr, [fp, #-40]	; 0xffffffd8    row
   1081c:	e24c6001 	sub	r6, ip, #1      ; r5 = col+1
   10820:	e50b6030 	str	r6, [fp, #-48]	; 0xffffffd0    fp-48 = 1
   10824:	e1a0600c 	mov	r6, ip          ; r6 = col
   10828:	e3a07000 	mov	r7, #0          ; r7 = 0
   1082c:	e1a03287 	lsl	r3, r7, #5      ; r3 = 0 << 5 = 0
   10830:	e1833da6 	orr	r3, r3, r6, lsr #27 ; r3= r3(11b) | col>>27
   10834:	e1a02286 	lsl	r2, r6, #5          ; r2 = col << 5
   10838:	e24e3001 	sub	r3, lr, #1          ; r3 = row+1
   1083c:	e50b3034 	str	r3, [fp, #-52]	; 0xffffffcc    fp-52 = r3
   10840:	e1a0300c 	mov	r3, ip          ; r3 = col
   10844:	e1a08003 	mov	r8, r3          ; r8 = col
   10848:	e3a09000 	mov	r9, #0          ; r9 = 0
   1084c:	e1a0300e 	mov	r3, lr          ; r3 = row
   10850:	e1a06003 	mov	r6, r3          ; r6 = row
   10854:	e3a07000 	mov	r7, #0          ; r7 = 0
   10858:	e0020996 	mul	r2, r6, r9      ; r2 = row * 0
   1085c:	e0030798 	mul	r3, r8, r7      ; r3 = col * 0
   10860:	e082a003 	add	sl, r2, r3      ; sl = 0
   10864:	e0832698 	umull	r2, r3, r8, r6 ; r2 = r8*r6(low 32bit) = row * col, r3 = r8*r6(high 32bit) row * col
   10868:	e08a6003 	add	r6, sl, r3         ; row = sl + row*col
   1086c:	e1a03006 	mov	r3, r6             ; r3 = row
   10870:	e1a05283 	lsl	r5, r3, #5         ; r5 = row<<5
   10874:	e1855da2 	orr	r5, r5, r2, lsr #27 ; r5 = r5(11b) | r2>>27
   10878:	e1a04282 	lsl	r4, r2, #5          ; r4 = 0<<5
   1087c:	e1a0300c 	mov	r3, ip              ; r3 = col
   10880:	e1a06003 	mov	r6, r3              ; r6 = col
   10884:	e3a07000 	mov	r7, #0              ; r7 = 0
   10888:	e1a0300e 	mov	r3, lr              ; r3 = row
   1088c:	e1a04003 	mov	r4, r3              ; r4 = row
   10890:	e3a05000 	mov	r5, #0              ; r5 = 0
   10894:	e0020794 	mul	r2, r4, r7          ; r2 = 0
   10898:	e0030596 	mul	r3, r6, r5          ; r3 = col * 0
   1089c:	e0828003 	add	r8, r2, r3          ; r8 = 0
   108a0:	e0832496 	umull	r2, r3, r6, r4  ; r2=r6*r4, r3=r6*r4
   108a4:	e0884003 	add	r4, r8, r3          ; r4 = 0
   108a8:	e1a03004 	mov	r3, r4              ; r3 = 0
   108ac:	e1a01283 	lsl	r1, r3, #5          ; r1 = 0<<5
   108b0:	e1811da2 	orr	r1, r1, r2, lsr #27 ; r1 = r1(11b)|r2>>27
   108b4:	e1a00282 	lsl	r0, r2, #5          ; r0 = 0 << 5
   108b8:	e1a0300c 	mov	r3, ip              ; r3 = row
   108bc:	e1a0200e 	mov	r2, lr              ; r2 = col
   108c0:	e0030392 	mul	r3, r2, r3          ; r3 = row*col
   108c4:	e1a03103 	lsl	r3, r3, #2          ; r3 = (row*col)<<2
   108c8:	e2833003 	add	r3, r3, #3          ; r3 = (row*col)<<2 +3
   108cc:	e2833007 	add	r3, r3, #7          ; r3 = (row*col)<<2+3+7
   108d0:	e1a031a3 	lsr	r3, r3, #3          ; r3 = ((row*col)<<2+3+7)>>3
   108d4:	e1a03183 	lsl	r3, r3, #3          ; r3 = (((row*col)<<2+3+7)>>3)<<3
   108d8:	e04dd003 	sub	sp, sp, r3          ; sp = sp - (((row*col)<<2+3+7)>>3)<<3
   108dc:	e1a0300d 	mov	r3, sp              ; r3 = sp - (((row*col)<<2+3+7)>>3)<<3
   108e0:	e2833003 	add	r3, r3, #3          ; r3 = (sp - (((row*col)<<2+3+7)>>3)<<3) + 3
   108e4:	e1a03123 	lsr	r3, r3, #2          ; r3 = ((sp-(((row*col)<<2+3+7)>>3)<<3)+3)>>2
   108e8:	e1a03103 	lsl	r3, r3, #2          ; r3 = (((sp-(((row*col)<<2+3+7)>>3)<<3)+3)>>2) << 2
   108ec:	e50b3038 	str	r3, [fp, #-56]	; 0xffffffc8
   108f0:	e51bd040 	ldr	sp, [fp, #-64]	; 0xffffffc0
	
	int array(int col, int row, int ary[col][row]);
	int arra2(int ary[col][row], int col, int row);	// not VLA
	
}
   108f4:	e1a00003 	mov	r0, r3
   108f8:	e24bd020 	sub	sp, fp, #32
   108fc:	e8bd8ff0 	pop	{r4, r5, r6, r7, r8, r9, sl, fp, pc}

00010900 <array_cal>:

int array_cal(void)
{
   10900:	e92d4800 	push	{fp, lr}
   10904:	e28db004 	add	fp, sp, #4
   10908:	e24dd028 	sub	sp, sp, #40	; 0x28
	int a[5]={1,2,3,4,9};
   1090c:	e59f31a8 	ldr	r3, [pc, #424]	; 10abc <array_cal+0x1bc>   parameter
   10910:	e24bc018 	sub	ip, fp, #24	; a
   10914:	e1a0e003 	mov	lr, r3		; lr = parameter address
   10918:	e8be000f 	ldm	lr!, {r0, r1, r2, r3}	; r0=lr=1, r1=lr+4=2, r2=lr+8=3, r3=lr+12=4
   1091c:	e8ac000f 	stmia	ip!, {r0, r1, r2, r3}	; ip=r0=1, ip+4=r1=2, ip+8=r2=3, ip+12=r3=4
   10920:	e59e3000 	ldr	r3, [lr]		; r3=lr+16=9
   10924:	e58c3000 	str	r3, [ip]		; ip+16=r3=9
	int *ptr1 = (int*)(&a + 1);
   10928:	e24b3018 	sub	r3, fp, #24		; 0x24  a
   1092c:	e2833014 	add	r3, r3, #20		; 4*5=20; &a + 1
   10930:	e50b301c 	str	r3, [fp, #-28]	; 0xffffffe4    ptr1
	int *ptr2 = (int*)((int)a + 1);
   10934:	e24b3018 	sub	r3, fp, #24 ; a
   10938:	e2833001 	add	r3, r3, #1  ; (int)a + 1.       note:illegal address
   1093c:	e50b3020 	str	r3, [fp, #-32]	; 0xffffffe0    ptr2
	int temp = (int)(&a + 1 );	// &a+1 = &a + sizeof(a) = &a + 5 * sizeof(int),也就是下一个数组的首地址.
   10940:	e24b3018 	sub	r3, fp, #24 ; a
   10944:	e2833014 	add	r3, r3, #20 ; 4*5=20
   10948:	e50b3024 	str	r3, [fp, #-36]	; 0xffffffdc    temp

	printf("temp - : %d, 0x%x, %x, 0x%x\n", temp, *ptr1, ptr1[-1], *ptr2);
   1094c:	e51b1024 	ldr	r1, [fp, #-36]	; 0xffffffdc    temp
   10950:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4    ptr1
   10954:	e5932000 	ldr	r2, [r3]        ; *ptr1
   10958:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4    ptr1
   1095c:	e2433004 	sub	r3, r3, #4      ; r3 = ptr-4
   10960:	e5930000 	ldr	r0, [r3]        ; r0 = ptr1[-1]
   10964:	e51b3020 	ldr	r3, [fp, #-32]	; 0xffffffe0    ptr2
   10968:	e5933000 	ldr	r3, [r3]        ; *ptr2
   1096c:	e58d3000 	str	r3, [sp]        ; segmentetion fault
   10970:	e1a03000 	mov	r3, r0          ; r3 = ptr1[-1]
   10974:	e59f0144 	ldr	r0, [pc, #324]	; 10ac0 <array_cal+0x1c0>   parameter
   10978:	ebfffe64 	bl	10310 <printf@plt>

	printf("a - 0x%x\n", a);				// 0x859033c0
   1097c:	e24b3018 	sub	r3, fp, #24 ; a
   10980:	e1a01003 	mov	r1, r3      ; r1 = a
   10984:	e59f0138 	ldr	r0, [pc, #312]	; 10ac4 <array_cal+0x1c4>
   10988:	ebfffe60 	bl	10310 <printf@plt>
	printf("a = 0x%x\n", &a);				// 0x859033c0
   1098c:	e24b3018 	sub	r3, fp, #24 ; a
   10990:	e1a01003 	mov	r1, r3      ; r1 = a
   10994:	e59f012c 	ldr	r0, [pc, #300]	; 10ac8 <array_cal+0x1c8>
   10998:	ebfffe5c 	bl	10310 <printf@plt>

	printf("a - 0x%x\n", a+1);				// 0x859033c4	0x859033c0+sizeof(int) = 0x859033c0+4 = 0x859033c4
   1099c:	e24b3018 	sub	r3, fp, #24 ; a
   109a0:	e2833004 	add	r3, r3, #4  ; a + 1
   109a4:	e1a01003 	mov	r1, r3
   109a8:	e59f0114 	ldr	r0, [pc, #276]	; 10ac4 <array_cal+0x1c4>
   109ac:	ebfffe57 	bl	10310 <printf@plt>
	printf("a = 0x%x\n", &a+1);				// 0x859033d4	0x859033d4 - 0x859033c0 = 0x14 = 20 = sizeof(a)
   109b0:	e24b3018 	sub	r3, fp, #24 ; a
   109b4:	e2833014 	add	r3, r3, #20 ; &a + 1 = a+sizeof(a) , sizeof(a)=20
   109b8:	e1a01003 	mov	r1, r3
   109bc:	e59f0104 	ldr	r0, [pc, #260]	; 10ac8 <array_cal+0x1c8>
   109c0:	ebfffe52 	bl	10310 <printf@plt>

	printf("temp - 0x%x\n", temp);			// 0x859033d4	&a + 1
   109c4:	e51b3024 	ldr	r3, [fp, #-36]	; 0xffffffdc    [fp -36]
   109c8:	e1a01003 	mov	r1, r3
   109cc:	e59f00f8 	ldr	r0, [pc, #248]	; 10acc <array_cal+0x1cc>
   109d0:	ebfffe4e 	bl	10310 <printf@plt>
	printf("temp = %p\n", temp);			// 0x859033d4	&a + 1	
   109d4:	e51b3024 	ldr	r3, [fp, #-36]	; 0xffffffdc    [fp-36]
   109d8:	e1a01003 	mov	r1, r3
   109dc:	e59f00ec 	ldr	r0, [pc, #236]	; 10ad0 <array_cal+0x1d0>
   109e0:	ebfffe4a 	bl	10310 <printf@plt>
	printf("temp = %p\n\n", &temp);			// 0x7ffd859033ac	temp self address
   109e4:	e24b3024 	sub	r3, fp, #36	; 0x24                  fp-36
   109e8:	e1a01003 	mov	r1, r3
   109ec:	e59f00e0 	ldr	r0, [pc, #224]	; 10ad4 <array_cal+0x1d4>
   109f0:	ebfffe46 	bl	10310 <printf@plt>

	printf("ptr1 - 0x%x, \n", *ptr1);		// 0x0				&a+1 value
   109f4:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4
   109f8:	e5933000 	ldr	r3, [r3]
   109fc:	e1a01003 	mov	r1, r3
   10a00:	e59f00d0 	ldr	r0, [pc, #208]	; 10ad8 <array_cal+0x1d8>
   10a04:	ebfffe41 	bl	10310 <printf@plt>
	printf("ptr1 - %p\n", *ptr1);			// (nil)			非法地址. 因为是空值，所以没有地址. 
   10a08:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4
   10a0c:	e5933000 	ldr	r3, [r3]
   10a10:	e1a01003 	mov	r1, r3
   10a14:	e59f00c0 	ldr	r0, [pc, #192]	; 10adc <array_cal+0x1dc>
   10a18:	ebfffe3c 	bl	10310 <printf@plt>
	printf("ptr1 - 0x%x\n", ptr1);			// 0x859033d4		&a+1 ---> %x
   10a1c:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4
   10a20:	e1a01003 	mov	r1, r3
   10a24:	e59f00b4 	ldr	r0, [pc, #180]	; 10ae0 <array_cal+0x1e0>
   10a28:	ebfffe38 	bl	10310 <printf@plt>
	printf("ptr1 - %p\n", ptr1);			// 0x7ffd859033d4	&a+1 ---> %p	
   10a2c:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4
   10a30:	e1a01003 	mov	r1, r3
   10a34:	e59f00a0 	ldr	r0, [pc, #160]	; 10adc <array_cal+0x1dc>
   10a38:	ebfffe34 	bl	10310 <printf@plt>
	printf("ptr1 - %p\n\n", &ptr1);			// 0x7ffd859033b0	ptr1 self address ---> %p
   10a3c:	e24b301c 	sub	r3, fp, #28
   10a40:	e1a01003 	mov	r1, r3
   10a44:	e59f0098 	ldr	r0, [pc, #152]	; 10ae4 <array_cal+0x1e4>
   10a48:	ebfffe30 	bl	10310 <printf@plt>

	printf("ptr1 - : 0x%x\n", ptr1[-1]);	// 0x9	
   10a4c:	e51b301c 	ldr	r3, [fp, #-28]	; 0xffffffe4    ptr1
   10a50:	e2433004 	sub	r3, r3, #4      ; ptr - 4 = ptr1[-1]
   10a54:	e5933000 	ldr	r3, [r3]        ; get value
   10a58:	e1a01003 	mov	r1, r3
   10a5c:	e59f0084 	ldr	r0, [pc, #132]	; 10ae8 <array_cal+0x1e8>
   10a60:	ebfffe2a 	bl	10310 <printf@plt>

	printf("ptr2 - : 0x%x\n", *ptr2);		// Segmentation fault	取非法地址值
   10a64:	e51b3020 	ldr	r3, [fp, #-32]	; 0xffffffe0    ptr2
   10a68:	e5933000 	ldr	r3, [r3]        ; get value,
   10a6c:	e1a01003 	mov	r1, r3
   10a70:	e59f0074 	ldr	r0, [pc, #116]	; 10aec <array_cal+0x1ec>
   10a74:	ebfffe25 	bl	10310 <printf@plt>
	printf("ptr2 - %p, \n", *ptr2);			// Segmentation fault	非法地址
   10a78:	e51b3020 	ldr	r3, [fp, #-32]	; 0xffffffe0
   10a7c:	e5933000 	ldr	r3, [r3]        ; get value
   10a80:	e1a01003 	mov	r1, r3
   10a84:	e59f0064 	ldr	r0, [pc, #100]	; 10af0 <array_cal+0x1f0>
   10a88:	ebfffe20 	bl	10310 <printf@plt>
	printf("ptr2 - %p\n", ptr2);			// 0xffffffff859033c1	指向的地址。0x859033c0 + 1 = 859033c1
   10a8c:	e51b3020 	ldr	r3, [fp, #-32]	; 0xffffffe0    ptr2
   10a90:	e1a01003 	mov	r1, r3          ; pointed address
   10a94:	e59f0058 	ldr	r0, [pc, #88]	; 10af4 <array_cal+0x1f4>
   10a98:	ebfffe1c 	bl	10310 <printf@plt>
	printf("ptr2 - %p\n\n", &ptr2);			// 0x7ffd859033b8		ptr2 self address ---> %p
   10a9c:	e24b3020 	sub	r3, fp, #32     ; ptr2
   10aa0:	e1a01003 	mov	r1, r3          ; self address
   10aa4:	e59f004c 	ldr	r0, [pc, #76]	; 10af8 <array_cal+0x1f8>
   10aa8:	ebfffe18 	bl	10310 <printf@plt>
		
	return 0;
   10aac:	e3a03000 	mov	r3, #0
}
   10ab0:	e1a00003 	mov	r0, r3
   10ab4:	e24bd004 	sub	sp, fp, #4
   10ab8:	e8bd8800 	pop	{fp, pc}
   10abc:	00010ddc 	.word	0x00010ddc
   10ac0:	00010cfc 	.word	0x00010cfc
   10ac4:	00010d1c 	.word	0x00010d1c
   10ac8:	00010d28 	.word	0x00010d28
   10acc:	00010d34 	.word	0x00010d34
   10ad0:	00010d44 	.word	0x00010d44
   10ad4:	00010d50 	.word	0x00010d50
   10ad8:	00010d5c 	.word	0x00010d5c
   10adc:	00010d6c 	.word	0x00010d6c
   10ae0:	00010d78 	.word	0x00010d78
   10ae4:	00010d88 	.word	0x00010d88
   10ae8:	00010d94 	.word	0x00010d94
   10aec:	00010da4 	.word	0x00010da4
   10af0:	00010db4 	.word	0x00010db4
   10af4:	00010dc4 	.word	0x00010dc4
   10af8:	00010dd0 	.word	0x00010dd0

00010afc <ccc>:

int ccc(void)
{
   10afc:	e92d4800 	push	{fp, lr}
   10b00:	e28db004 	add	fp, sp, #4
   10b04:	e24dd030 	sub	sp, sp, #48	; 0x30
	int array[10] = {11, 15, 20, 25, 30};
   10b08:	e24b3030 	sub	r3, fp, #48	; 0x30  r3 = fp - 48
   10b0c:	e3a02000 	mov	r2, #0
   10b10:	e5832000 	str	r2, [r3] ; fp-48 = 0
   10b14:	e2833004 	add	r3, r3, #4 ; r3 = fp - 44
   10b18:	e3a02000 	mov	r2, #0
   10b1c:	e5832000 	str	r2, [r3] ; fp-44 = 0
   10b20:	e2833004 	add	r3, r3, #4 ; r3 = fp-40
   10b24:	e3a02000 	mov	r2, #0
   10b28:	e5832000 	str	r2, [r3] ; fp-40 = 0
   10b2c:	e2833004 	add	r3, r3, #4 ; r3 = fp-36
   10b30:	e3a02000 	mov	r2, #0
   10b34:	e5832000 	str	r2, [r3] ; fp-36 = 0
   10b38:	e2833004 	add	r3, r3, #4 ; r3 = fp - 32
   10b3c:	e3a02000 	mov	r2, #0
   10b40:	e5832000 	str	r2, [r3] ; fp-32 = 0
   10b44:	e2833004 	add	r3, r3, #4 ; r3 = fp-28
   10b48:	e3a02000 	mov	r2, #0
   10b4c:	e5832000 	str	r2, [r3] ; fp-28 = 0
   10b50:	e2833004 	add	r3, r3, #4 ; r3 = fp - 24
   10b54:	e3a02000 	mov	r2, #0
   10b58:	e5832000 	str	r2, [r3] ; fp-24 = 0
   10b5c:	e2833004 	add	r3, r3, #4 ; r3 = fp-20
   10b60:	e3a02000 	mov	r2, #0
   10b64:	e5832000 	str	r2, [r3] ; fp-20 = 0
   10b68:	e2833004 	add	r3, r3, #4 ; fp-16
   10b6c:	e3a02000 	mov	r2, #0
   10b70:	e5832000 	str	r2, [r3] ; fp-16=0
   10b74:	e2833004 	add	r3, r3, #4 ; fp-12
   10b78:	e3a02000 	mov	r2, #0
   10b7c:	e5832000 	str	r2, [r3] ; fp-12=0
   10b80:	e2833004 	add	r3, r3, #4 ; r3 = fp-8
   10b84:	e3a0300b 	mov	r3, #11
   10b88:	e50b3030 	str	r3, [fp, #-48]	; 0xffffffd0    fp-48 = 11  array[0]
   10b8c:	e3a0300f 	mov	r3, #15
   10b90:	e50b302c 	str	r3, [fp, #-44]	; 0xffffffd4    fp-44 = 15  array[1]
   10b94:	e3a03014 	mov	r3, #20 
   10b98:	e50b3028 	str	r3, [fp, #-40]	; 0xffffffd8    fp-40 = 20  array[2]
   10b9c:	e3a03019 	mov	r3, #25
   10ba0:	e50b3024 	str	r3, [fp, #-36]	; 0xffffffdc    fp-36 = 25  array[3]
   10ba4:	e3a0301e 	mov	r3, #30
   10ba8:	e50b3020 	str	r3, [fp, #-32]	; 0xffffffe0    fp-32 = 30  array[4]
	int *p;
	
	p = &array[2];
   10bac:	e24b3030 	sub	r3, fp, #48	; 0x30  array address
   10bb0:	e2833008 	add	r3, r3, #8  ; fp - 48 + 8 = fp -40 ---> array[2]
   10bb4:	e50b3008 	str	r3, [fp, #-8] ; p
	printf("%d\n", *p);			// 20 = array[2]
   10bb8:	e51b3008 	ldr	r3, [fp, #-8] ; p
   10bbc:	e5933000 	ldr	r3, [r3]      ; *p = 20
   10bc0:	e1a01003 	mov	r1, r3        ; r1 = 20
   10bc4:	e59f0050 	ldr	r0, [pc, #80]	; 10c1c <ccc+0x120>
   10bc8:	ebfffdd0 	bl	10310 <printf@plt>
	printf("%d\n", p[-1]);		// 15 = array[1]
   10bcc:	e51b3008 	ldr	r3, [fp, #-8] ; p 
   10bd0:	e2433004 	sub	r3, r3, #4    ; p address - 4 ----> array[1] = 15
   10bd4:	e5933000 	ldr	r3, [r3]      ; r3 = p[-1] = 15
   10bd8:	e1a01003 	mov	r1, r3        ; r1 = r3 = 15
   10bdc:	e59f0038 	ldr	r0, [pc, #56]	; 10c1c <ccc+0x120>
   10be0:	ebfffdca 	bl	10310 <printf@plt>
	printf("%d\n", *(p-2));		// 11 = array[1]   *(p-2) = p[-2]
   10be4:	e51b3008 	ldr	r3, [fp, #-8] ; p
   10be8:	e2433008 	sub	r3, r3, #8    ; p address - 8 ----> array[0] = 11
   10bec:	e5933000 	ldr	r3, [r3]      ; *(p-2) = 11
   10bf0:	e1a01003 	mov	r1, r3        ; r1 = 11
   10bf4:	e59f0020 	ldr	r0, [pc, #32]	; 10c1c <ccc+0x120>
   10bf8:	ebfffdc4 	bl	10310 <printf@plt>
	
	printf("%d\n", array[9]);	// 0
   10bfc:	e51b300c 	ldr	r3, [fp, #-12] ; array[9] = 0
   10c00:	e1a01003 	mov	r1, r3         ; r1 = 0
   10c04:	e59f0010 	ldr	r0, [pc, #16]	; 10c1c <ccc+0x120>
   10c08:	ebfffdc0 	bl	10310 <printf@plt>
	return 0;
   10c0c:	e3a03000 	mov	r3, #0
}
   10c10:	e1a00003 	mov	r0, r3
   10c14:	e24bd004 	sub	sp, fp, #4
   10c18:	e8bd8800 	pop	{fp, pc}
   10c1c:	00010df0 	.word	0x00010df0

00010c20 <main>:

int main()
{
   10c20:	e92d4800 	push	{fp, lr}
   10c24:	e28db004 	add	fp, sp, #4
	array1();
   10c28:	ebfffe18 	bl	10490 <array1>
	array2();
   10c2c:	ebfffe3b 	bl	10520 <array2>
	array3();
   10c30:	ebfffe41 	bl	1053c <array3>
	array4();
   10c34:	ebfffe59 	bl	105a0 <array4>

	array_cal();
   10c38:	ebffff30 	bl	10900 <array_cal>
	ccc();
   10c3c:	ebffffae 	bl	10afc <ccc>

	return 0;
   10c40:	e3a03000 	mov	r3, #0
}
   10c44:	e1a00003 	mov	r0, r3
   10c48:	e8bd8800 	pop	{fp, pc}

#endif

